﻿using System.Runtime.Serialization;

namespace CoreLibrary.Service {
    
    /// <summary>
    /// NOTE: any change made to this class must be made to the equivalent class at client side.
    /// </summary>
    [DataContract]
    public class ServiceError {

        [DataMember]
        public ErrorCode Code { get; private set;}

        [DataMember]
        public string Message { get; private set; }

        [DataMember]
        public string Details { get; private set; }

        public ServiceError(ErrorCode code, string message) : this(code, message, "") {
        }

        public ServiceError(ErrorCode code, string message, string details) {
            Code = code;
            Message = message;
            Details = details;
        }
    }
}